/*
 * Copyright (c) 2006-2025, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-02-20     RT-Thread    first version
 */

#include <rtthread.h>

#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>


#define SSID    "xjaujsj"
#define PASSWD  "1223334444"

int main(void)
{


    //--------connect AP--------
      extern rt_err_t rt_wlan_connect(const char *ssid, const char *password);
      rt_err_t wifi_join_res = RT_ERROR;
      while(RT_EOK != wifi_join_res){
          rt_thread_mdelay(5000);
          wifi_join_res = rt_wlan_connect(SSID,PASSWD);
          LOG_E("WIFI connect failed, please check AP name and password, try to connect again......");
      }

    return RT_EOK;
}
